﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Configuration;

namespace CodePlex.TfsPluginSuite.Configuration
{
    [ConfigurationCollection(typeof(RequiredWorkItemsConfigurationElement), AddItemName = "RequiredWorkItems", CollectionType = ConfigurationElementCollectionType.BasicMap)]
    public class RequiredWorkItemsPolicyConfigurationElementCollection : ConfigurationElementCollection
    {
        protected override ConfigurationElement CreateNewElement()
        {
            return new RequiredWorkItemsConfigurationElement();
        }

        protected override object GetElementKey(ConfigurationElement element)
        {
            if (element == null)
                throw new ArgumentNullException("element");

            return ((RequiredWorkItemsConfigurationElement)element).Name;
        }

        [ConfigurationProperty("enabled", IsRequired = true)]
        public bool Enabled
        {
            get
            {
                return (bool)base["enabled"];
            }
        }
    }
}
